package muilt.ip;

import java.net.InetSocketAddress;

import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClients;
import org.junit.Test;

import muilt.DriverProxyTest;

public class RunHttpIp extends DriverProxyTest{
	@Test
	public void test() throws Exception{
		 
//			driver.get("http://www.baidu.com");
//			String s = driver.getPageSource();
//	        if(s.indexOf("百度")>0){
//	           System.out.println("ok");
//	        }
			
			
			chined.setChainedProxy(new InetSocketAddress("123.160.1.114", 9999));
			driver.get("https://www.baidu.com");
			String s = driver.getPageSource();
	        if(s.indexOf("百度")>0){
	           System.out.println("ok");
	        }
		 
	        chined.setChainedProxy(new InetSocketAddress("119.23.79.199", 3128));
			driver.get("https://www.baidu.com");
			s = driver.getPageSource();
	        if(s.indexOf("百度")>0){
	           System.out.println("ok");
	        }
	}
	
	
	public HttpClient getClient(){ 
		return  HttpClients.createDefault();
	}
	 
}
